<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.util.*"%>

<%
/*
新增
*/
DBO db=new DBO();//初始数据库链接
request.setCharacterEncoding("utf-8");//设置字符集
ResultSet rs=null;//声明结果集
			String id=(String)request.getParameter("id");//变量:id
			String applyusername=(String)request.getParameter("applyusername");//变量:申请人
			String applydate=(String)request.getParameter("applydate");//变量:申请时间
			String mobile=(String)request.getParameter("mobile");//变量:联系电话
			String title=(String)request.getParameter("title");//变量:活动名称
			String usercount=(String)request.getParameter("usercount");//变量:用户数量
			String bj=(String)request.getParameter("bj");//变量:班级
			String actitvtyroom=(String)request.getParameter("actitvtyroom");//变量:活动室
			String appointmentdate=(String)request.getParameter("appointmentdate");//变量:预约时间
			String remark=(String)request.getParameter("remark");//变量:备注
			String status=(String)request.getParameter("status");//变量:状态
			String auditor=(String)request.getParameter("auditor");//变量:审核人
String sql="";//保存sql
 sql="insert into actitvtyappointment( applyusername, applydate, mobile, title, usercount, bj, actitvtyroom, appointmentdate, remark, status,auditor"
 +")"+
 "values('"+applyusername+"', '"+applydate+"', '"+mobile+"', '"+title+"', '"+usercount+"', '"+bj+"', '"+actitvtyroom+"', '"+appointmentdate+"', '"+remark+"', '"+status+"', '"+auditor+"')";//保存sql
int row=1;///定义执行结果
		
try{

	
		//int row =0;
		row=db.update(sql);
}catch(Exception e){
System.out.println(e.toString());}
if(row==1){
out.println("<script>");
out.println("alert('操作成功');");
out.println("window.location='add.jsp'");
out.println("</script>");
}else{
out.println("<script>");
out.println("alert('操作失败');");
out.println("window.location='add.jsp'");
out.println("</script>");
}
db.close();
%>

